<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="dao.UtilisateurDAO"%>
<%@page import="model.ShareUser"%>
<%@page import="java.util.List"%>

<jsp:include page="/WEB-INF/headerProfil.jsp" />

<article class="module width_3_quarter">
	<header>
		<h3 class="tabs_involved">Information sur le compte</h3>
	</header>

	<div class="tab_container">
		<div>
			<%
				//recuperation du cookie contenant la variable idUser
				Cookie[] lesCookies = request.getCookies();
				int idUser = Integer.parseInt(lesCookies[1].getValue());

				ShareUser user = new ShareUser();
				UtilisateurDAO userDAO = new UtilisateurDAO();

				user = userDAO.getUserById(idUser);
			%>

			<form id="changeUser" method="post" action="profilUser">
				<div class="module_content">
					<fieldset>
						<label>Adresse Mail</label><input type="text" id="emailUser" name="emailUser" value="<%out.print(user.getMailUser());%>" />
					</fieldset>
					<fieldset>
						<label>Login</label><input type="text" id="loginUser" name="loginUser" value="<%out.print(user.getLogin());%>" />
					</fieldset>
					<fieldset>
						<label>Mot de passe</label><input type="text" id="mdpUser" name="mdpUser" value="<%out.print(user.getPassword());%>" />
					</fieldset>
					<input type="submit" value="Modifier" />
				</div>
			</form>

		</div>
	</div>

</article>

</section>


</body>

</html>
